<template>
  <div class="dashboard-container">
    <div class="dashboard-text">name: {{ name }}</div>
    <div>name:{{ $store.state.user.token }}</div>
    <!-- <h-click @click="hihi" /> -->
    <h-click @click.native="hihi" />
    <my-com-1 v-model="num" />
    <my-com-2 :a.sync="num2" :b.sync="num3" />
  </div>
</template>

<script>
import { mapGetters } from 'vuex'
import { getUserProfile } from '@/api/user'
import MyCom1 from './MyCom1.vue'
import MyCom2 from './MyCom2.vue'
// 测试native
import hClick from './hClick.vue'
export default {
  name: 'Dashboard',
  components: { hClick, MyCom1, MyCom2 },
  data() {
    return {
      num: 100,
      num2: 111,
      num3: 333
    }
  },
  computed: {
    ...mapGetters([
      'name'
    ])
  },
  created() {
    getUserProfile()
  },
  methods: {
    hihi() {
      alert(1)
    },
    MyCom1() {
      this.num = 200
    }
  }

}
</script>

<style lang="scss" scoped>
.dashboard {
  &-container {
    margin: 30px;
  }
  &-text {
    font-size: 30px;
    line-height: 46px;
  }
}
</style>
